/*
 * @Author: TT-hzy
 * @Date: 2024-06-27 18:40:45
 * @LastEditors: TT-hzy
 * @LastEditTime: 2024-06-29 10:31:46
 * @Description:
 */
// test/factories.js
'use strict';

const { factory } = require('factory-girl');

module.exports = app => {
  // 可以通过 app.factory 访问 factory 实例
  app.factory = factory;

  // 定义 user 模型和默认数据
  factory.define('user', app.model.User, {
    name: factory.sequence('User.name', n => `name_${n}`),
    age: 18,
  });
};
